import React from 'react'
import { Tooltip, Checkbox } from 'antd'

const getColumns = (setRecord, setOpen, handleChecked, paramsData, data) => {
  const manualColumns = [
    {
      title: '序号',
      width: 60,
      dataIndex: 'key',
      align: 'center',
      render: (_, __, index) => `${index + 1}`
    },
    {
      title: '企业名称',
      width: 120,
      dataIndex: 'ent_name',
      align: 'center',
      render: (text, record) => {
        return (
          <a
            onClick={() => { 
              record.start_time = paramsData.start_time
              record.end_time = paramsData.end_time
              setRecord(record)
              setOpen(true)
            }}
          >
            {text}
          </a>
        )
      }
    },
    {
      title: '所属区县名称',
      width: 80,
      dataIndex: 'county_name',
      align: 'center'
    },
    {
      title: '重点行业类型',
      width: 80,
      dataIndex: 'industry_type_1',
      align: 'center'
    },
    {
      title: '重点行业分支',
      width: 80,
      dataIndex: 'industry_type_2',
      align: 'center'
    },
    {
      title: '其它行业分支',
      width: 80,
      dataIndex: 'industry_type_3',
      align: 'center',
      render: (v) => (v ? v : '-')
    },
    {
      title: '停限产措施',
      width: 90,
      dataIndex: 'measure_old',
      align: 'center',
      // render: (text) => {
      //   if (!text) return
      //   return (
      //     <Tooltip title={text}>
      //       <div
      //         style={{
      //           overflow: 'hidden',
      //           textOverflow: 'ellipsis',
      //           whiteSpace: 'nowrap'
      //         }}
      //       >
      //         {text}
      //       </div>
      //     </Tooltip>
      //   )
      // }
      render: (v) => (v ? v : '-')
    },
    {
      title: '生产工序',
      width: 100,
      dataIndex: 'production_process',
      align: 'center',
      render: (v) => (v ? v : '-')
    },
    {
      title: '是否落实措施(自动)',
      width: 80,
      dataIndex: 'is_measure_voluntarily',
      align: 'center'
    },
    {
      title: '自动未落实措施时长',
      width: 80,
      dataIndex: 'is_measure_voluntarily_time',
      align: 'center'
    },
    {
      title: '是否落实措施(手工)',
      width: 80,
      dataIndex: 'is_measure_craft',
      align: 'center',
      editable: true,
      render: (v) => (v ? v : '-')
    },
    {
      title: '未落实措施时长(手工)',
      width: 80,
      dataIndex: 'is_measure_craft_time',
      align: 'center',
      editable: true,
      render: (v) => (v ? v : '-')
    },
    {
      title: '是否夜间生产',
      width: 80,
      dataIndex: 'is_night',
      align: 'center',
      editable: true,
      // render: (v, record) => {
      //   const checked = v == '是' ? true : false
      //   return (
      //     <Checkbox
      //       onChange={(e) => {
      //         handleChecked(record, 'is_night', data)
      //       }}
      //       checked={checked}
      //     />
      //   )
      // }
    },
    {
      title: '是否典型案例',
      width: 80,
      dataIndex: 'is_model',
      align: 'center',
      editable: true
    },
    {
      title: '此刻是否落实措施',
      width: 80,
      dataIndex: 'is_implement_now',
      align: 'center',
      editable: true
    }
  ]
  return manualColumns
}

export default getColumns
